package com.martin.fastframe.ui.ceiling

import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.databinding.ViewDataBinding
import androidx.lifecycle.asLiveData
import com.martin.fastframe.ui.main.TextViewHolder
import com.martin.lib_base.base.BaseListActivity
import com.martin.lib_base.base.BaseViewHolder
import com.martin.lib_base.impl.FlowBus

class CeilingActivity : BaseListActivity<CeilingViewModel>() {

    override fun getViewHolders(): List<Class<out BaseViewHolder<*, out ViewDataBinding>>> {
        return listOf(CeilingViewHolder::class.java, TextViewHolder::class.java)
    }

    override fun getTopTitle() = "吸顶效果"

    override fun getViewModelClass(): Class<CeilingViewModel> {
        return CeilingViewModel::class.java
    }

    override fun initOnCreate(savedInstanceState: Bundle?) {
        super.initOnCreate(savedInstanceState)
        viewModel.ceilingModel.handleCeiling(binding.rv)

        FlowBus.with<Any>("")
            .asLiveData()
    }

    companion object {
        @JvmStatic
        fun start(context: Context) {
            val starter = Intent(context, CeilingActivity::class.java)
            context.startActivity(starter)
        }
    }

}